// server > app.js
const Koa = require('koa')
const cors = require('koa2-cors') // 处理跨域
const bodyParser = require('koa-bodyparser'); // 帮助koa解析post请求的参数
const userRouter = require('./routes/user')

const app = new Koa()
app.use(bodyParser());

app.use(cors());

app.use(userRouter.routes(), userRouter.allowedMethods())


app.listen(3000, () => console.log('服务已在3000端口启动'))

